require "extend/BaseTablePool"

local P = NewClass(BaseTablePool, ClassFromFile(...))

local keyArr = {}

function P:New()
	return {}
end

function P:Recycle(v)
	if not v then
		return
	end
	if type(v) ~= "table" then
		return
	end
	local keyLen = 0
	for k,_ in pairs(v) do
		keyLen = keyLen + 1
		if keyLen <= #keyArr then
			keyArr[keyLen] = k
		else
			table.insert(keyArr, k)
		end
	end

	for i = 1, keyLen do
		v[keyArr[i]] = nil
	end

	P.super.Recycle(self, v)
end

